﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 纸片人.win2dEffectControl.DataClass
{
    public class HighlightsAndShadowsEffectData : EffectOneSourceData
    {
        private float clarity;
        private float highlights;
        private float maskBlurAmount=1.25f;
        private float shadows;
        private bool sourceIsLinearGamma;



        public float Clarity { get => clarity; set { clarity = value; OnPropertyChanged(); SetIsChanges(); } }
        public float Highlights { get => highlights; set { highlights = value; OnPropertyChanged(); SetIsChanges(); } }
        public float MaskBlurAmount { get => maskBlurAmount; set { maskBlurAmount = value; OnPropertyChanged(); SetIsChanges(); } }
        public float Shadows { get => shadows; set { shadows = value; OnPropertyChanged(); SetIsChanges(); } }
        public bool SourceIsLinearGamma { get => sourceIsLinearGamma; set { sourceIsLinearGamma = value; OnPropertyChanged(); SetIsChanges(); } }

        #region 属性

        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
                return null;

            var effect = new HighlightsAndShadowsEffect()
            {
                Source = source,
                Clarity = Clarity,
                Highlights = Highlights,
                MaskBlurAmount = MaskBlurAmount,
                Shadows = Shadows,
                SourceIsLinearGamma = SourceIsLinearGamma,

            };

            return effect;
        }
    }
}


